package com.ruoyi.product.controller;

import java.util.List;

import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.product.domain.PmsSpuInfo;
import com.ruoyi.product.service.IPmsSpuInfoService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.domain.Result;

/**
 * spu信息Controller
 *
 * @author ruoyi
 * @date 2025-01-14
 */
@RestController
@RequestMapping("/spuInfo")
public class PmsSpuInfoController extends BaseController
{
    @Autowired
    private IPmsSpuInfoService pmsSpuInfoService;

    /**
     * 查询spu信息列表
     */
    @RequiresPermissions("product:spuInfo:list")
    @GetMapping("/list")
    public TableDataInfo list(PmsSpuInfo pmsSpuInfo)
    {
        startPage();
        List<PmsSpuInfo> list = pmsSpuInfoService.selectPmsSpuInfoList(pmsSpuInfo);
        return getDataTable(list);
    }

    /**
     * 新增spu信息
     */
    @PostMapping("/{spuId}")
    public Result up(@PathVariable Long spuId) {
        pmsSpuInfoService.up(spuId);
        return Result.success();
    }




}
